package com.love.netty.core.interfaces.impl;

import com.love.netty.core.interfaces.ConsoleCommand;
import com.love.netty.core.packet.request.ListGroupMembersRequestPacket;
import io.netty.channel.Channel;

import java.util.Scanner;

/**
 * @ClassName: ListGroupMembersConsoleCommand
 * @Description: 获取成员列表
 * @Author: wuj
 * @Date: 2021-06-25 15:50
 **/
public class ListGroupMembersConsoleCommand implements ConsoleCommand {
    @Override
    public void exec(Scanner scanner, Channel channel) {
        ListGroupMembersRequestPacket listGroupMembersRequestPacket = new ListGroupMembersRequestPacket();

        System.out.print("输入 groupId，获取群成员列表：");
        String groupId = scanner.next();

        listGroupMembersRequestPacket.setGroupId(groupId);
        channel.writeAndFlush(listGroupMembersRequestPacket);

    }
}
